package com.ruoyi.erp.mapper;

import com.ruoyi.erp.domain.XzgProduct;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface XzgProductMapper {
    int deleteByPrimaryKey(Long productId);

    int insert(XzgProduct record);

    int insertSelective(XzgProduct record);

    XzgProduct selectByPrimaryKey(Long productId);

    int updateByPrimaryKeySelective(XzgProduct record);

    int updateByPrimaryKey(XzgProduct record);

    int selectSameName(@Param("id") Long id, @Param("name") String name);

    int selectSameCode(@Param("id") Long id, @Param("code") String code);

    List<XzgProduct> selectProductList(XzgProduct product);

    int logicDeleteProductById(@Param("productIds") Long[] productIds, @Param("username") String username);

    List<XzgProduct> selectByCodeOrName(String name);

    Integer selectCountById(Long productId);

    int reduceStorage(@Param("productId") Long productId, @Param("actualNum") Integer actualNum, @Param("username") String username);

    int updateStorageByProductId(@Param("productId") Long productId, @Param("actualNum") Integer actualNum, @Param("username") String username);

    XzgProduct selectByCode(String productCode);
}